#ifndef CWatchdog_HPP
#define CWatchdog_HPP

// System includes

// Other includes
#include "CObserver.hpp"
#include "CSerialReader.hpp"

class CObserver;
class CCommand;

class CWatchdog : public CObserver
{
public:
   ~CWatchdog();

   void setSerialReaderPointer(CSerialReader* pSerialReader);
   void handleEvent(const CCommand& cmd);
   void start();

   static CWatchdog* getInstance();
protected:

private:
   CWatchdog();

   int getMilliCount();

   int getMilliSpan(int nTimeStart);

   static CWatchdog* mSelf;
   CSerialReader* mpSerialReader;
   int mLastOnlineEventTime;
};

#endif // CWatchdog_HPP